#ifndef MY_CLIENT_H
#define MY_CLIENT_H
#include <QTcpSocket>
#include <QObject>

class my_client : public QTcpSocket
{
    Q_OBJECT
public:
    my_client(QObject *parent = nullptr);
    void set_server_info(QString ip);
    void connect_server(void);
    // 原始数据做base64转码发送
    void sendData(QString data);

private:
    QString server_ip;
    quint16 server_port = 0;

signals:
    void client_recvsignal(QString data);
    void client_Connected(QTcpSocket *ServerSocket);
    void client_Disconnected(QTcpSocket *ServerSocket);
public slots:
    // 当有数据来时的槽函数
    void readyReadData();
    void connect_cb(void);
    void disconnect_cb(void);
};

#endif // MY_CLIENT_H
